package cn.xo68.boot.core;

import cn.xo68.core.util.JsonUtil;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class CoreAutoConfiguration {

    @ConditionalOnMissingBean
    @Bean
    public JsonUtil jsonUtil(@Autowired(required = false) ObjectMapper objectMapper){
        return new JsonUtil(objectMapper);
    }
}
